//------------------------------------------------------------------------------
#include "CMimeType.h"
//------------------------------------------------------------------------------
CMimeType *CMimeType::_instance=NULL;
//------------------------------------------------------------------------------
CMimeType * CMimeType::getInstance(void)
{		
	if(_instance == NULL)
	{	
		_instance=new CMimeType();
	}
	
	return _instance;
}
//------------------------------------------------------------------------------
QString CMimeType::getMimeType(QString ext)
{
	ext=ext.toLower();
	if(_mimeType.contains(ext))
	{
		return _mimeType[ext];
	}
	
	return "application/octet-stream";
}
//------------------------------------------------------------------------------
QList<QString> CMimeType::getExtensions(QString mimeType)
{
	return _mimeType.keys(mimeType.toLower());
}
//------------------------------------------------------------------------------
CMimeType::CMimeType()
{
	_mimeType["ez"]="application/andrew-inset";
	_mimeType["atom"]="application/atom";
	_mimeType["atomcat"]="application/atomcat+xml";
	_mimeType["atomsrv"]="application/atomserv+xml";
	_mimeType["cap"]=_mimeType["pcap"]="application/cap";
	_mimeType["cu"]="application/cu-seeme";
	_mimeType["tsp"]="application/dsptype";
	_mimeType["spl"]="application/x-futuresplash";
	_mimeType["hta"]="application/hta";
	_mimeType["jar"]="application/java-archive";
	_mimeType["ser"]="application/java-serialized-object";
	_mimeType["class"]="application/java-vm";
	_mimeType["hqx"]="application/mac-binhex40";
	_mimeType["cpt"]="image/x-corelphotopaint";
	_mimeType["nb"]="application/mathematica";
	_mimeType["mdb"]="application/msaccess";
	_mimeType["doc"]=_mimeType["dot"]="application/msword";
	_mimeType["bin"]="application/octet-stream";
	_mimeType["oda"]="application/oda";
	_mimeType["ogg"]=_mimeType["ogx"]="application/ogg";
	_mimeType["pdf"]="application/pdf";
	_mimeType["key"]="application/pgp-keys";
	_mimeType["pgp"]="application/pgp-signature";
	_mimeType["prf"]="application/pics-rules";
	_mimeType["ps"]=_mimeType["ai"]=_mimeType["eps"]="application/postscript";
	_mimeType["rar"]="application/rar";
	_mimeType["rdf"]="application/rdf+xml";
	_mimeType["rss"]="application/rss+xml";
	_mimeType["rtf"]="application/rtf";
	_mimeType["smi"]=_mimeType["smil"]="application/smil";
	_mimeType["wpd"]="application/wordperfect";
	_mimeType["wp5"]="application/wordperfect5.1";
	_mimeType["xhtml"]=_mimeType["xht"]="application/xhtml+xml";
	_mimeType["xml"]=_mimeType["xsl"]="application/xml";
	_mimeType["zip"]="application/zip";
	_mimeType["cdy"]="application/vnd.cinderella";
	_mimeType["kml"]="application/vnd.google-earth.kml+xml";
	_mimeType["kmz"]="application/vnd.google-earth.kmz";
	_mimeType["xul"]="application/vnd.mozilla.xul+xml";
	_mimeType["xls"]=_mimeType["xlb"]=_mimeType["xlt"]="application/vnd.ms-excel";
	_mimeType["cat"]="application/vnd.ms-pki.seccat";
	_mimeType["stl"]="application/vnd.ms-pki.stl";
	_mimeType["ppt"]=_mimeType["pps"]="application/vnd.ms-powerpoint";
	_mimeType["odc"]="application/vnd.oasis.opendocument.chart";
	_mimeType["odb"]="application/vnd.oasis.opendocument.database";
	_mimeType["odf"]="application/vnd.oasis.opendocument.formula";
	_mimeType["odg"]="application/vnd.oasis.opendocument.graphics";
	_mimeType["otg"]="application/vnd.oasis.opendocument.graphics-template";
	_mimeType["odi"]="application/vnd.oasis.opendocument.image";
	_mimeType["odp"]="application/vnd.oasis.opendocument.presentation";
	_mimeType["otp"]="application/vnd.oasis.opendocument.presentation-template";
	_mimeType["ods"]="application/vnd.oasis.opendocument.spreadsheet";
	_mimeType["ots"]="application/vnd.oasis.opendocument.spreadsheet-template";
	_mimeType["odt"]="application/vnd.oasis.opendocument.text";
	_mimeType["odm"]="application/vnd.oasis.opendocument.text-master";
	_mimeType["ott"]="application/vnd.oasis.opendocument.text-template";
	_mimeType["oth"]="application/vnd.oasis.opendocument.text-web";
	_mimeType["docm"]="application/vnd.ms-word.document.macroEnabled.12";
	_mimeType["docx"]="application/vnd.openxmlformats-officedocument.wordprocessingml.document";
	_mimeType["dotm"]="application/vnd.ms-word.template.macroEnabled.12";
	_mimeType["dotx"]="application/vnd.openxmlformats-officedocument.wordprocessingml.template";
	_mimeType["potm"]="application/vnd.ms-powerpoint.template.macroEnabled.12";
	_mimeType["potx"]="application/vnd.openxmlformats-officedocument.presentationml.template";
	_mimeType["ppam"]="application/vnd.ms-powerpoint.addin.macroEnabled.12";
	_mimeType["ppsm"]="application/vnd.ms-powerpoint.slideshow.macroEnabled.12";
	_mimeType["ppsx"]="application/vnd.openxmlformats-officedocument.presentationml.slideshow";
	_mimeType["pptm"]="application/vnd.ms-powerpoint.presentation.macroEnabled.12";
	_mimeType["pptx"]="application/vnd.openxmlformats-officedocument.presentationml.presentation";
	_mimeType["xlam"]="application/vnd.ms-excel.addin.macroEnabled.12";
	_mimeType["xlsb"]="application/vnd.ms-excel.sheet.binary.macroEnabled.12";
	_mimeType["xlsm"]="application/vnd.ms-excel.sheet.macroEnabled.12";
	_mimeType["xlsx"]="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
	_mimeType["xltm"]="application/vnd.ms-excel.template.macroEnabled.12";
	_mimeType["xltx"]="application/vnd.openxmlformats-officedocument.spreadsheetml.template";
	_mimeType["cod"]="application/vnd.rim.cod";
	_mimeType["mmf"]="application/vnd.smaf";
	_mimeType["sdc"]="application/vnd.stardivision.calc";
	_mimeType["sds"]="application/vnd.stardivision.chart";
	_mimeType["sda"]="application/vnd.stardivision.draw";
	_mimeType["sdd"]="application/vnd.stardivision.impress";
	_mimeType["sdf"]="application/vnd.stardivision.math";
	_mimeType["sdw"]="application/vnd.stardivision.writer";
	_mimeType["sgl"]="application/vnd.stardivision.writer-global";
	_mimeType["sxc"]="application/vnd.sun.xml.calc";
	_mimeType["stc"]="application/vnd.sun.xml.calc.template";
	_mimeType["sxd"]="application/vnd.sun.xml.draw";
	_mimeType["std"]="application/vnd.sun.xml.draw.template";
	_mimeType["sxi"]="application/vnd.sun.xml.impress";
	_mimeType["sti"]="application/vnd.sun.xml.impress.template";
	_mimeType["sxm"]="application/vnd.sun.xml.math";
	_mimeType["sxw"]="application/vnd.sun.xml.writer";
	_mimeType["sxg"]="application/vnd.sun.xml.writer.global";
	_mimeType["stw"]="application/vnd.sun.xml.writer.template";
	_mimeType["sis"]="application/vnd.symbian.install";
	_mimeType["vsd"]="application/vnd.visio";
	_mimeType["wbxml"]="application/vnd.wap.wbxml";
	_mimeType["wmlc"]="application/vnd.wap.wmlc";
	_mimeType["wmlsc"]="application/vnd.wap.wmlscriptc";
	_mimeType["wk"]="application/x-123";
	_mimeType["7z"]="application/x-7z-compressed";
	_mimeType["abw"]="application/x-abiword";
	_mimeType["dmg"]="application/x-apple-diskimage";
	_mimeType["bcpio"]="application/x-bcpio";
	_mimeType["torrent"]="application/x-bittorrent";
	_mimeType["cab"]="application/x-cab";
	_mimeType["cbr"]="application/x-cbr";
	_mimeType["cbz"]="application/x-cbz";
	_mimeType["cdf"]="application/x-cdf";
	_mimeType["vcd"]="application/x-cdlink";
	_mimeType["pgn"]="application/x-chess-pgn";
	_mimeType["cpio"]="application/x-cpio";
	_mimeType["csh"]="text/x-csh";
	_mimeType["deb"]=_mimeType["udeb"]="application/x-debian-package";
	_mimeType["dcr"]=_mimeType["dir"]=_mimeType["dxr"]="application/x-director";
	_mimeType["dms"]="application/x-dms";
	_mimeType["wad"]="application/x-doom";
	_mimeType["dvi"]="application/x-dvi";
	_mimeType["rhtml"]="application/x-httpd-eruby";
	_mimeType["flac"]="application/x-flac";
	_mimeType["pfa"]=_mimeType["pfb"]=_mimeType["gsf"]=_mimeType["pcf"]=_mimeType["pcf.Z"]="application/x-font";
	_mimeType["mm"]="application/x-freemind";
	_mimeType["gnumeric"]="application/x-gnumeric";
	_mimeType["sgf"]="application/x-go-sgf";
	_mimeType["gcf"]="application/x-graphing-calculator";
	_mimeType["gtar"]=_mimeType["tgz"]=_mimeType["taz"]="application/x-gtar";
	_mimeType["hdf"]="application/x-hdf";
	_mimeType["phtml"]=_mimeType["pht"]=_mimeType["php"]="application/x-httpd-php";
	_mimeType["phps"]="application/x-httpd-php-source";
	_mimeType["php3"]="application/x-httpd-php3";
	_mimeType["php3p"]="application/x-httpd-php3-preprocessed";
	_mimeType["php4"]="application/x-httpd-php4";
	_mimeType["ica"]="application/x-ica";
	_mimeType["ins"]=_mimeType["isp"]="application/x-internet-signup";
	_mimeType["iii"]="application/x-iphone";
	_mimeType["iso"]="application/x-iso9660-image";
	_mimeType["jnlp"]="application/x-java-jnlp-file";
	_mimeType["js"]="application/x-javascript";
	_mimeType["jmz"]="application/x-jmol";
	_mimeType["chrt"]="application/x-kchart";
	_mimeType["kil"]="application/x-killustrator";
	_mimeType["skp"]=_mimeType["skd"]=_mimeType["skt"]=_mimeType["skm"]="application/x-koan";
	_mimeType["kpr"]=_mimeType["kpt"]="application/x-kpresenter";
	_mimeType["ksp"]="application/x-kspread";
	_mimeType["kwd"]=_mimeType["kwt"]="application/x-kword";
	_mimeType["latex"]="application/x-latex";
	_mimeType["lha"]="application/x-lha";
	_mimeType["lyx"]="application/x-lyx";
	_mimeType["lzh"]="application/x-lzh";
	_mimeType["lzx"]="application/x-lzx";
	_mimeType["frm"]=_mimeType["maker"]=_mimeType["frame"]=_mimeType["fm"]="application/x-maker";
	_mimeType["fb"]=_mimeType["book"]=_mimeType["fbdoc"]="application/x-maker";
	_mimeType["mif"]="application/x-mif";
	_mimeType["wmd"]="application/x-ms-wmd";
	_mimeType["wmz"]="application/x-ms-wmz";
	_mimeType["com"]=_mimeType["exe"]=_mimeType["bat"]=_mimeType["dll"]="application/x-msdos-program";
	_mimeType["msi"]="application/x-msi";
	_mimeType["nc"]="application/x-netcdf";
	_mimeType["pac"]="application/x-ns-proxy-autoconfig";
	_mimeType["nwc"]="application/x-nwc";
	_mimeType["o"]="application/x-object";
	_mimeType["oza"]="application/x-oz-application";
	_mimeType["p7r"]="application/x-pkcs7-certreqresp";
	_mimeType["crl"]="application/x-pkcs7-crl";
	_mimeType["pyc"]=_mimeType["pyo"]="application/x-python-code";
	_mimeType["qtl"]="application/x-quicktimeplayer";
	_mimeType["rpm"]="application/x-redhat-package-manager";
	_mimeType["sh"]="text/x-sh";
	_mimeType["shar"]="application/x-shar";
	_mimeType["swf"]=_mimeType["swfl"]="application/x-shockwave-flash";
	_mimeType["sit"]=_mimeType["sitx"]="application/x-stuffit";
	_mimeType["sv4cpio"]="application/x-sv4cpio";
	_mimeType["sv4crc"]="application/x-sv4crc";
	_mimeType["tar"]="application/x-tar";
	_mimeType["tcl"]="application/x-tcl";
	_mimeType["gf"]="application/x-tex-gf";
	_mimeType["pk"]="application/x-tex-pk";
	_mimeType["texinfo"]=_mimeType["texi"]="application/x-texinfo";
	_mimeType["~"]=_mimeType["%"]=_mimeType["bak"]=_mimeType["old"]=_mimeType["sik"]="application/x-trash";
	_mimeType["t"]=_mimeType["tr"]=_mimeType["roff"]="application/x-troff";
	_mimeType["man"]="application/x-troff-man";
	_mimeType["me"]="application/x-troff-me";
	_mimeType["ms"]="application/x-troff-ms";
	_mimeType["ustar"]="application/x-ustar";
	_mimeType["src"]="application/x-wais-source";
	_mimeType["wz"]="application/x-wingz";
	_mimeType["crt"]="application/x-x509-ca-cert";
	_mimeType["xcf"]="application/x-xcf";
	_mimeType["fig"]="application/x-xfig";
	_mimeType["xpi"]="application/x-xpinstall";
	_mimeType["au"]=_mimeType["snd"]="audio/basic";
	_mimeType["mid"]=_mimeType["midi"]=_mimeType["kar"]="audio/midi";
	_mimeType["mpga"]=_mimeType["mpega"]=_mimeType["mp2"]=_mimeType["mp3"]=_mimeType["m4a"]="audio/mpeg";
	_mimeType["m3u"]="audio/x-mpegurl";
	_mimeType["oga"]=_mimeType["spx"]="audio/ogg";
	_mimeType["sid"]="audio/prs.sid";
	_mimeType["aif"]=_mimeType["aiff"]=_mimeType["aifc"]="audio/x-aiff";
	_mimeType["gsm"]="audio/x-gsm";
	_mimeType["wma"]="audio/x-ms-wma";
	_mimeType["wax"]="audio/x-ms-wax";
	_mimeType["ra"]=_mimeType["rm"]=_mimeType["ram"]="audio/x-pn-realaudio";
	_mimeType["ra"]="audio/x-realaudio";
	_mimeType["pls"]="audio/x-scpls";
	_mimeType["sd2"]="audio/x-sd2";
	_mimeType["wav"]="audio/x-wav";
	_mimeType["alc"]="chemical/x-alchemy";
	_mimeType["cac"]=_mimeType["cache"]="chemical/x-cache";
	_mimeType["csf"]="chemical/x-cache-csf";
	_mimeType["cbin"]=_mimeType["cascii"]=_mimeType["ctab"]="chemical/x-cactvs-binary";
	_mimeType["cdx"]="chemical/x-cdx";
	_mimeType["cer"]="chemical/x-cerius";
	_mimeType["c3d"]="chemical/x-chem3d";
	_mimeType["chm"]="chemical/x-chemdraw";
	_mimeType["cif"]="chemical/x-cif";
	_mimeType["cmdf"]="chemical/x-cmdf";
	_mimeType["cml"]="chemical/x-cml";
	_mimeType["cpa"]="chemical/x-compass";
	_mimeType["bsd"]="chemical/x-crossfire";
	_mimeType["csml"]=_mimeType["csm"]="chemical/x-csml";
	_mimeType["ctx"]="chemical/x-ctx";
	_mimeType["cxf"]=_mimeType["cef"]="chemical/x-cxf";
	_mimeType["emb"]=_mimeType["embl"]="chemical/x-embl-dl-nucleotide";
	_mimeType["spc"]="chemical/x-galactic-spc";
	_mimeType["inp"]=_mimeType["gam"]=_mimeType["gamin"]="chemical/x-gamess-input";
	_mimeType["fch"]=_mimeType["fchk"]="chemical/x-gaussian-checkpoint";
	_mimeType["cub"]="chemical/x-gaussian-cube";
	_mimeType["gau"]=_mimeType["gjc"]=_mimeType["gjf"]="chemical/x-gaussian-input";
	_mimeType["gal"]="chemical/x-gaussian-log";
	_mimeType["gcg"]="chemical/x-gcg8-sequence";
	_mimeType["gen"]="chemical/x-genbank";
	_mimeType["hin"]="chemical/x-hin";
	_mimeType["istr"]=_mimeType["ist"]="chemical/x-isostar";
	_mimeType["jdx"]=_mimeType["dx"]="chemical/x-jcamp-dx";
	_mimeType["kin"]="chemical/x-kinemage";
	_mimeType["mcm"]="chemical/x-macmolecule";
	_mimeType["mmd"]=_mimeType["mmod"]="chemical/x-macromodel-input";
	_mimeType["mol"]="chemical/x-mdl-molfile";
	_mimeType["rd"]="chemical/x-mdl-rdfile";
	_mimeType["rxn"]="chemical/x-mdl-rxnfile";
	_mimeType["sd"]=_mimeType["sdf"]="chemical/x-mdl-sdfile";
	_mimeType["tgf"]="chemical/x-mdl-tgf";
	_mimeType["mcif"]="chemical/x-mmcif";
	_mimeType["mol2"]="chemical/x-mol2";
	_mimeType["b"]="chemical/x-molconn-Z";
	_mimeType["gpt"]="chemical/x-mopac-graph";
	_mimeType["mop"]=_mimeType["mopcrt"]=_mimeType["mpc"]=_mimeType["dat"]=_mimeType["zmt"]="chemical/x-mopac-input";
	_mimeType["moo"]="chemical/x-mopac-out";
	_mimeType["mvb"]="chemical/x-mopac-vib";
	_mimeType["asn"]="chemical/x-ncbi-asn1-spec";
	_mimeType["prt"]=_mimeType["ent"]="chemical/x-ncbi-asn1-ascii";
	_mimeType["val"]=_mimeType["aso"]="chemical/x-ncbi-asn1-binary";
	_mimeType["pdb"]=_mimeType["ent"]="chemical/x-pdb";
	_mimeType["ros"]="chemical/x-rosdal";
	_mimeType["sw"]="chemical/x-swissprot";
	_mimeType["vms"]="chemical/x-vamas-iso14976";
	_mimeType["vmd"]="chemical/x-vmd";
	_mimeType["xtel"]="chemical/x-xtel";
	_mimeType["xyz"]="chemical/x-xyz";
	_mimeType["gif"]="image/gif";
	_mimeType["ief"]="image/ief";
	_mimeType["jpeg"]=_mimeType["jpg"]=_mimeType["jpe"]="image/jpeg";
	_mimeType["pcx"]="image/pcx";
	_mimeType["png"]="image/png";
	_mimeType["svg"]=_mimeType["svgz"]="image/svg+xml";
	_mimeType["tiff"]=_mimeType["tif"]="image/tiff";
	_mimeType["djvu"]=_mimeType["djv"]="image/vnd.djvu";
	_mimeType["wbmp"]="image/vnd.wap.wbmp";
	_mimeType["ras"]="image/x-cmu-raster";
	_mimeType["cdr"]="image/x-coreldraw";
	_mimeType["pat"]="image/x-coreldrawpattern";
	_mimeType["cdt"]="image/x-coreldrawtemplate";
	_mimeType["ico"]="image/x-icon";
	_mimeType["art"]="image/x-jg";
	_mimeType["jng"]="image/x-jng";
	_mimeType["bmp"]="image/x-ms-bmp";
	_mimeType["psd"]="image/x-photoshop";
	_mimeType["pnm"]="image/x-portable-anymap";
	_mimeType["pbm"]="image/x-portable-bitmap";
	_mimeType["pgm"]="image/x-portable-graymap";
	_mimeType["ppm"]="image/x-portable-pixmap";
	_mimeType["rgb"]="image/x-rgb";
	_mimeType["xbm"]="image/x-xbitmap";
	_mimeType["xpm"]="image/x-xpixmap";
	_mimeType["xwd"]="image/x-xwindowdump";
	_mimeType["eml"]="message/rfc822";
	_mimeType["igs"]=_mimeType["iges"]="model/iges";
	_mimeType["msh"]=_mimeType["mesh"]=_mimeType["silo"]="model/mesh";
	_mimeType["wrl"]=_mimeType["vrml"]="model/vrml";
	_mimeType["ics"]=_mimeType["icz"]="text/calendar";
	_mimeType["css"]="text/css";
	_mimeType["csv"]="text/csv";
	_mimeType["323"]="text/h323";
	_mimeType["html"]=_mimeType["htm"]=_mimeType["shtml"]="text/html";
	_mimeType["uls"]="text/iuls";
	_mimeType["mml"]="text/mathml";
	_mimeType["txt"]=_mimeType["asc"]=_mimeType["text"]=_mimeType["pot"]="text/plain";
	_mimeType["rtx"]="text/richtext";
	_mimeType["sct"]=_mimeType["wsc"]="text/scriptlet";
	_mimeType["tm"]=_mimeType["ts"]="text/texmacs";
	_mimeType["tsv"]="text/tab-separated-values";
	_mimeType["jad"]="text/vnd.sun.j2me.app-descriptor";
	_mimeType["wml"]="text/vnd.wap.wml";
	_mimeType["wmls"]="text/vnd.wap.wmlscript";
	_mimeType["bib"]="text/x-bibtex";
	_mimeType["boo"]="text/x-boo";
	_mimeType["h++"]=_mimeType["hpp"]=_mimeType["hxx"]=_mimeType["hh"]="text/x-c++hdr";
	_mimeType["c++"]=_mimeType["cpp"]=_mimeType["cxx"]=_mimeType["cc"]="text/x-c++src";
	_mimeType["h"]="text/x-chdr";
	_mimeType["htc"]="text/x-component";
	_mimeType["c"]="text/x-csrc";
	_mimeType["d"]="text/x-dsrc";
	_mimeType["diff"]=_mimeType["patch"]="text/x-diff";
	_mimeType["hs"]="text/x-haskell";
	_mimeType["java"]="text/x-java";
	_mimeType["lhs"]="text/x-literate-haskell";
	_mimeType["moc"]="text/x-moc";
	_mimeType["p"]=_mimeType["pas"]="text/x-pascal";
	_mimeType["gcd"]="text/x-pcs-gcd";
	_mimeType["pl"]=_mimeType["pm"]="text/x-perl";
	_mimeType["py"]="text/x-python";
	_mimeType["etx"]="text/x-setext";
	_mimeType["tcl"]=_mimeType["tk"]="text/x-tcl";
	_mimeType["tex"]=_mimeType["ltx"]=_mimeType["sty"]=_mimeType["ls"]="text/x-tex";
	_mimeType["vcs"]="text/x-vcalendar";
	_mimeType["vcf"]="text/x-vcard";
	_mimeType["3gp"]="video/3gpp";
	_mimeType["dl"]="video/dl";
	_mimeType["dif"]=_mimeType["dv"]="video/dv";
	_mimeType["fli"]="video/fli";
	_mimeType["gl"]="video/gl";
	_mimeType["mpeg"]=_mimeType["mpg"]=_mimeType["mpe"]="video/mpeg";
	_mimeType["mp4"]="video/mp4";
	_mimeType["ogv"]="video/ogg";
	_mimeType["qt"]=_mimeType["mov"]="video/quicktime";
	_mimeType["mxu"]="video/vnd.mpegurl";
	_mimeType["lsf"]=_mimeType["lsx"]="video/x-la-asf";
	_mimeType["mng"]="video/x-mng";
	_mimeType["asf"]=_mimeType["asx"]="video/x-ms-asf";
	_mimeType["wm"]="video/x-ms-wm";
	_mimeType["wmv"]="video/x-ms-wmv";
	_mimeType["wmx"]="video/x-ms-wmx";
	_mimeType["wvx"]="video/x-ms-wvx";
	_mimeType["avi"]="video/x-msvideo";
	_mimeType["movie"]="video/x-sgi-movie";
	_mimeType["ice"]="x-conference/x-cooltalk";
	_mimeType["sisx"]="x-epoc/x-sisx-app";
	_mimeType["vrm"]=_mimeType["vrml"]=_mimeType["wrl"]="x-world/x-vrml";
	_mimeType["xps"]="application/vnd.ms-xpsdocument";
}
//------------------------------------------------------------------------------